﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
<div class="adv-lft">
    <%List<Advertising> listAdvertising = (List<Advertising>)ViewData["AdvertisingLeft"];
      int y = 0;
      for (int i = 0; i < listAdvertising.Count; i += 4)
      {%>
    <table width="100%" border="0" cellspacing="2" cellpadding="2">
        <%for (int z = 0; z < 4; z++)
          {
              if (y < listAdvertising.Count)
              {
                  Advertising obj = listAdvertising[y];
                  string link = string.Empty;
                  if (obj.IsIntenalLink)
                  {
                      link = "<a href='" + FRouter._("quangcao", obj.ID.ToString(), obj.Title) + "' >";
                  }
                  else
                  {
                      link = "<a href='/" + obj.ExternalLink + "' >";
                  }
                  link += "<img src='" + Constants.UPLOAD_ADV_IMAGE_PATH + obj.Image + "' title='" + obj.Title + "' width=\"248\" height=\"99\" style=\"border: 2px solid #CCCCCC\"/></a>";
        %>
        <tr>
            <td>
                <%=link%>
                <%--<a style="font-weight: bold" href="<%=FRouter._("khuyenmai", obj.ID.ToString(), obj.Title) %>">
                    <img src="<%=Constants.PHOTO_PATH_ROOT_PARTNER + (!string.IsNullOrEmpty(obj.Image)?obj.Image:"NoImage.jpg") %>"
                        width="248" height="99" style="border: 2px solid #CCCCCC" /></a>--%>
            </td>
        </tr>
        <%y++;
              }
          } %>
    </table>
    <%} %>
</div>
<script type="text/javascript">
    $(document).ready(function () {
        $('.adv-lft').cycle({
            fx: 'fade',
            delay: 4000,
            pause: 1
        });
    });
</script>
